﻿using GameServer.Virtual_Objects.User;

namespace GameServer.Networking
{
    class PacketHandler
    {
        private long Timestamp = 0;
        private int ID = 0;
        public string[] Blocks;
        private int currBlock = -1;

        public void set(long Timestamp, int ID, string[] Blocks)
        {
            this.Timestamp = Timestamp;
            this.ID = ID;
            this.Blocks = Blocks;
            this.currBlock = -1;
        }

        public string getNextBlock()
        {
            this.currBlock++;
            return this.Blocks[currBlock];
        }

        public string[] getAllBlocks()
        {
            return this.Blocks;
        }

        public string getBlock(int I)
        {
            this.currBlock = I;
            return this.Blocks[I];
        }

        public virtual void Handle(virtualUser User)
        {
            /* Override */
        }

        public virtual void HandlePacket(virtualUser User, PacketHandler Packet)
        {
            /* Override */
        }
    }
}
